package com.bit.strongbaby;

import java.util.ArrayList;

import com.bit.strongbaby.*;

import android.os.Bundle;
import android.R.color;
import android.app.Activity;
import android.graphics.drawable.ColorDrawable;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ListviewActivity extends Activity {

	ArrayList<String> a1;
	ArrayAdapter<String> adapter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_listview);
		
		
		a1 = new ArrayList<String>();
		
		a1.add("이동욱");
		a1.add("이동욱이");
		a1.add("이동욱이동");
		a1.add("이동욱이동욱");
		a1.add("이동욱이동욱이");
		a1.add("이동욱이동욱이동");
		a1.add("이동욱이동욱이동욱");
		a1.add("이동욱이동욱이동욱");
		a1.add("이동욱이동욱이동욱");
	
		adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, a1);
		
		ListView list = (ListView)findViewById(R.id.listview1);
		list.setAdapter(adapter);
		
		list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
		list.setDivider(new ColorDrawable(color.black));
		list.setDividerHeight(5);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.listview, menu);
		return true;
	}

}
